package uk.org.fuzelogik.eldaw.auth;

import java.io.Serializable;


/**
 * Base class for local authentication strategy implementations.
 * 
 * @author cgdavies
 */
public abstract class LocalAuthenticationStrategy implements
	ILocalAuthenticationStrategy, Serializable
{
	private String m_userId;

	final public boolean signIn( String username, String password )
	{
		if( authenticate( username, password ) )
		{
			m_userId = username;
			return true;
		}

		return false;
	}

	final public String getAuthenticatedUserId()
	{
		return m_userId;
	}

	final public boolean isSignedIn()
	{
		return ( m_userId != null );
	}
}
